package com.harmonk.firstscene.db.repository

import com.harmonk.firstscene.db.dao.VehicleDao
import com.harmonk.firstscene.db.entity.Vehicle
import kotlinx.coroutines.flow.Flow

class VehicleRepository(private val vehicleDao: VehicleDao) {
    
    suspend fun getVehicleById(id: Long): Vehicle? = vehicleDao.getVehicleById(id)
    
    fun getVehiclesByEventId(eventId: Long): Flow<List<Vehicle>> = vehicleDao.getVehiclesByEventId(eventId)
    
    suspend fun insertVehicle(vehicle: Vehicle): Long = vehicleDao.insertVehicle(vehicle)
    
    suspend fun updateVehicle(vehicle: Vehicle) = vehicleDao.updateVehicle(vehicle)
    
    suspend fun deleteVehicle(vehicle: Vehicle) = vehicleDao.deleteVehicle(vehicle)
    
    suspend fun deleteVehiclesByEventId(eventId: Long): Int = vehicleDao.deleteVehiclesByEventId(eventId)
}